import React, { Component } from 'react';
import { autorun } from 'mobx';
import MyRoute from './router';
import Tabbar from './components/Tabbar';

import store from './mobx/store';

import './css/index.css';

export default class App extends Component {
  state = {
    showBar: true,
  };

  componentDidMount() {
    autorun(() => {
      console.log('store.tabbarShow', store.tabbarShow);
      this.setState({
        showBar: store.tabbarShow,
      });
    });
  }

  render() {
    return (
      <>
        {/* 其他内容 */}
        <MyRoute>{this.state.showBar && <Tabbar></Tabbar>}</MyRoute>
      </>
    );
  }
}
